
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="/static/admin/index/jquery.min.js"></script>
    <script src="/static/admin/index/echarts.min.js"></script>
    <script src="/static/admin/index/vue.min.js"></script>
    <script src="/static/admin/index/MagicCusJSFun.js"></script>
    <script src="/static/admin/index/HttpRequest.js"></script>
    <script src="/static/admin/index/axios.min.js"></script>
    <link rel="stylesheet" href="/static/admin/index/index.css">
    <!-- 引入组件库 -->
    <script src="/static/admin/index/index.js"></script>
    <style>

        #app {
            background-color: #F3F3F3;
            padding: 15px;
        }

        .top-item:hover p {
            color: #3369ff;
        }

        .documenDataItem:hover p {
            color: #3369ff;
        }

        .top {
            display: flex;
            justify-content: space-between;
        }

        .top .top-item {
            width: 22%;
            padding: 1%;
            background-color: #ffffff;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .top .top-item img {
            width: 72px;
            height: 72px;
        }

        .top .prese {
            font-size: 28px;
        }

        .documenData {
            display: flex;

            margin: 10px auto;
        }

        .documenData .documenDataItem {
            width: 24%;
            margin-right: 1%;
            padding: 15px 0;
            text-align: left;
            justify-content: left;
            background-color: #FFFFFF;
        }

        .documenData .documenDataItem:last-child {
            margin-right: 0;
        }

        .documenData .documenDataItem .documenDataItemImg {
            display: flex;
            align-items: center;
            margin-left: 30px;
        }

        .documenData .documenDataItem .documenDataItemImg img {
            width: 20px;
            height: 20px;
            margin-right: 8px;
        }

        .documenData .documenDataItem .documenDataItemTxt {
            display: flex;
            align-items: center;
            margin-left: 30px;
            font-size: 28px;
        }

        .doucment_member {
            background-color: #ffffff;
            padding: 15px;
        }

        .doucment_member .tt {
            font-size: 20px;
            font-weight: 700;
            margin-bottom: 15px;
        }

        .doucment_member .doucment_member_list {
            display: flex;
            flex-wrap: wrap;
        }

        .doucment_member .doucment_member_list .doucment_member_list_item {
            width: 23%;
            padding: 5px 2%;
            padding-left: 0;
            display: flex;
            position: relative;
            justify-content: space-between;
        }

        .doucment_member .doucment_member_list .doucment_member_list_item::before {
            content: "";
            position: absolute;
            width: 1px;
            background-color: #DDDDDD;
            top: 5%;
            height: 80%;
            right: 2%;

        }

        .doucment_member .doucment_member_list .doucment_member_list_item .left_tt {

            text-align: left;
        }

        .doucment_member .doucment_member_list .doucment_member_list_item .left_tt div {
            font-size: 14px;
        }

        .doucment_member .doucment_member_list .doucment_member_list_item .left_tt p {
            font-size: 18px;
            font-weight: 700;
        }

        .doucment_member .doucment_member_list .doucment_member_list_item .right_tt {

            text-align: right;
        }

        .doucment_member .doucment_member_list .doucment_member_list_item .right_tt div {
            font-size: 14px;
            color: rgba(0, 0, 0, 0.4);
        }

        .doucment_member .doucment_member_list .doucment_member_list_item .right_tt p {
            font-size: 14px;
            color: #D54941;
        }

        .fee {
            padding: 15px 0;
            display: flex;
            justify-content: space-between;
        }

        .businessbar {
            padding: 15px 1%;
            display: flex;
            justify-content: space-between;

            width: 95%;
            height: 450px;
            background-color: #fff;
        }

        #businessbar {
            width: 90%;
            height: 400px;
            margin: 0 auto;
        }

        .fee .feeCount {
            width: 30%;
            height: 450px;
            background-color: #fff;
        }

        .fee #feeCount {
            width: 95%;
            height: 400px;
            margin: 0 auto;
        }

        .fee .feeOrderCount {
            width: 68%;
            height: 450px;
            background-color: #fff;
        }

        .fee #feeOrderCount {
            width: 95%;
            height: 400px;
            margin: 0 auto;
        }

        .fee .tts {
            font-size: 20px;
            font-weight: 700;
            padding: 15px;
        }

        .tts {
            font-size: 20px;
            font-weight: 700;
            padding: 15px;
        }

        .top p, .documenDataItemImg p {
            font-size: 20px;
            font-weight: 700;
        }

        .good_member {
            padding: 15px 0;
            display: flex;
        }

        .good_member .good_member_item {
            width: 30%;
            background-color: #fff;
            padding: 1%;
        }

        .good_member .good_member_item:nth-child(2) {
            margin: 0 2%;
        }

        .good_member .good_member_item .tt {
            font-size: 20px;
            font-weight: 700;
        }

        .good_member .good_member_item .good_member_top {
            display: flex;
            width: 100%;
            height: 92px;
            border: 1px solid #DDDDDD;
            margin-top: 20px;
        }

        .good_member .good_member_item .good_member_top .good_member_top_item {

            width: 50%;

            text-align: center;

            padding-top: 18px;

            position: relative;
        }

        .good_member .good_member_item .good_member_top .good_member_top_item:nth-child(1):before {
            content: "";
            width: 1px;
            height: 50%;
            background-color: #DDDDDD;
            position: absolute;
            top: 25%;
            right: 0;

        }

        .good_member .good_member_item .good_member_top .good_member_top_item .tts {
            font-size: 14px;
            color: #999999;
        }

        .good_member .good_member_item .good_member_top .good_member_top_item p {
            font-size: 18px;
        }

        .good_member .good_member_item .good_member_list_header {
            display: flex;
        }

        .good_member .good_member_item .good_member_list_header .good_member_list_header_item {
            color: rgba(0, 0, 0, 0.4);
            font-size: 14px;
            line-height: 60px;
            text-align: center;
        }

        .good_member .good_member_item .good_member_list_header .good_member_list_header_item:nth-child(1) {
            width: 10%;
        }

        .good_member .good_member_item .good_member_list_header .good_member_list_header_item:nth-child(2) {
            width: 70%;
        }

        .good_member .good_member_item .good_member_list_header .good_member_list_header_item:nth-child(3) {
            width: 20%;
        }


        .good_member .good_member_item .good_member_list {

        }

        .good_member .good_member_item .good_member_list {
            color: rgba(0, 0, 0, 0.4);
            font-size: 14px;
            line-height: 60px;
            display: flex;
            align-items: center;
            text-align: center;
            justify-content: center;
        }

        .good_member .good_member_item .good_member_list .good_member_list_item:nth-child(1) {
            width: 10%;
        }

        .good_member .good_member_item .good_member_list .good_member_list_item:nth-child(1) .yuan {
            width: 24px;
            height: 24px;
            background: #0052D9;
            opacity: 1;
            color: #fff;
            line-height: 24px;
            font-size: 14px;
            border-radius: 50%;
            margin: 0 auto;
        }

        .good_member .good_member_item .good_member_list .good_member_list_item:nth-child(2) {
            width: 70%;
        }

        .good_member .good_member_item .good_member_list .good_member_list_item:nth-child(3) {
            width: 20%;
        }

        .nopic {
            display: flex;
            justify-content: center;
            align-items: center;
        }

        a {
            text-decoration: none;
            color: inherit;
        }

        .fee {
            padding: 15px 0;
            display: flex;
            justify-content: space-between;
        }
        .fee .feeCount {
            width: 30%;
            height: 450px;
            background-color: #fff;
        }

        .fee #feeCount {
            width: 95%;
            height: 400px;
            margin: 0 auto;
        }

        .fee .feeOrderCount {
            width: 68%;
            height: 450px;
            background-color: #fff;
        }

        .fee #feeOrderCount {
            width: 95%;
            height: 400px;
            margin: 0 auto;
        }

        .fee .tts {
            font-size: 20px;
            font-weight: 700;
            padding: 15px;
        }
    </style>
    <script src="/static/admin/index/echarts.min.js"></script>

</head>
<body>
<div id="app">

    <div>
        <div class="top">
            <div class="top-item">
                <div class="top-item-left">
                    <!--                    <a href='{:url("/admin/business.ebusiness?status=0")}'>-->
                    <p>会员数量</p>
                    <div class="prese">
                        {{a}}
                    </div>
                    <!--                    </a>-->
                </div>
                <div class="top-item-right">
                    <img src="/static/admin/index/ljfk.png" alt="">
                </div>

            </div>
            <div class="top-item">
                <div class="top-item-left">
                    <!--                    <a href='{:url("/admin/goods.egoods")}'>-->
                    <p>订单数量</p>
                    <div class="prese">
                        {{b}}
                    </div>
                    <!--                    </a>-->
                </div>
                <div class="top-item-right">
                    <img src="/static/admin/index/all-application.png" alt="">

                </div>
            </div>
            <div class="top-item">
                <div class="top-item-left">
                    <!--                    <a href='{:url("/admin/question.questionfback")}'>-->
                    <p>商品数量</p>

                    <div class="prese">
                        {{c}}
                    </div>
                    <!--                    </a>-->
                </div>
                <div class="top-item-right">
                    <img src="/static/admin/index/yzcyh.png" alt="">
                </div>
            </div>

            <div class="top-item">
                <div class="top-item-left">
                    <!--                    <a href='{:url("/admin/finance.tixian")}'>-->
                    <p>助力订单</p>
                    <div class="prese">
                        {{d}}
                    </div>
                    <!--                    </a>-->
                </div>
                <div class="top-item-right">
                    <img src="/static/admin/index/hash.png" alt="">
                </div>
            </div>
        </div>

        <div class="documenData">
            <div class="documenDataItem">
                <!--                <a href='{:url("/admin/business.business")}'>-->
                <div class="documenDataItemImg">
                    <img src="/static/admin/index/wdzjps.png" alt="">
                    <p>订单金额：</p>
                </div>
                <div class="documenDataItemTxt">
                    {{z_data.a}}
                </div>
                <!--                </a>-->
            </div>

            <div class="documenDataItem">
                <!--                <a href='{:url("/admin/goods.goods")}'>-->
                <div class="documenDataItemImg">
                    <img src="/static/admin/index/ptwd.png" alt="">
                    <p>退款金额：</p>
                </div>
                <div class="documenDataItemTxt">
                    {{z_data.b}}
                </div>
                <!--                </a>-->
            </div>

            <div class="documenDataItem">
                <!--                <a href='{:url("/admin/goods.goods")}'>-->
                <div class="documenDataItemImg">
                    <img src="/static/admin/index/wdhyrs.png" alt="">

                    <p>代理余额：</p>
                </div>
                <div class="documenDataItemTxt">
                    {{z_data.c}}
                </div>
                <!--                </a>-->
            </div>
            <div class="documenDataItem">
                <!--                <a href='{:url("/admin/order.morder")}'>-->
                <div class="documenDataItemImg">
                    <img src="/static/admin/index/yzwd.png" alt="">
                    <p>提现中：</p>
                </div>
                <div class="documenDataItemTxt">
                    {{z_data.d}}
                </div>
                <!--                </a>-->
            </div>
            <div class="documenDataItem">
                <!--                <a href='{:url("/admin/order.morder")}'>-->
                <div class="documenDataItemImg">
                    <img src="/static/admin/index/jpwd.png" alt="">

                    <p>已提现：</p>
                </div>
                <div class="documenDataItemTxt">
                    {{z_data.e}}
                </div>
                <!--                </a>-->
            </div>
        </div>

        <div class="fee">
            <div class="feeCount">
                <div class="tts">商品类型订单</div>
                <div id="feeCount">

                </div>
            </div>
            <div class="feeOrderCount">
                <div class="tts">商品数量排行</div>
                <div id="feeOrderCount">

                </div>
            </div>
        </div>

    </div>
</div>
<script>
    var app = new Vue({
        data() {
            return {
                a: 0,
                b: 0,
                c: 0,
                d: 0,
                e: 0,
                timerId: null,
                z_data: {},
                pie_data:[
                    { value: 1048, name: 'Search Engine' },
                    { value: 735, name: 'Direct' },
                    { value: 580, name: 'Email' },
                    { value: 484, name: 'Union Ads' },
                    { value: 300, name: 'Video Ads' }
                ],
                bar_type1:[],
                bar_type2:[]
            }
        },
        mounted() {
            this.GetDate()
            this.GetDate2()
            this.getpie()
            this.getbar()


            this.timerId = setInterval(this.GetDate, 5000);
            this.timerId = setInterval(this.GetDate2, 5000);
            this.timerId = setInterval(this.getpie, 5000);
            this.timerId = setInterval(this.getbar, 5000);

        },
        methods: {
            open2() {
                this.$message({
                    message: '恭喜你，这是一条成功消息',
                    type: 'success'
                });
            },
            GetDate() {
                axios.get('{:url('/cIndex')}').
                then(response => {
                    $data = response.data;
                    $result = $data.data;
                    this.a = $result.a;
                    this.b = $result.b;
                    this.c = $result.c;
                    this.d = $result.d;
                    this.e = $result.e;

                }).catch(error => {
                    console.error('There was an error!', error);
                });
            },
            GetDate2() {
                axios.get('{:url('/cIndex2')}').
                then(response => {
                    $data = response.data;
                    $result = $data.data;
                    this.z_data = $result;
                }).catch(error => {
                    console.error('There was an error!', error);
                });
            },
            getpie(){
                var chartDom = document.getElementById('feeCount');
                var myChart = echarts.init(chartDom);
                var option;
                axios.get('{:url('/getPie')}').
                then(response => {
                    $data = response.data;
                    $result = $data.data;
                    this.pie_data = $result;
                    option = {
                        tooltip: {
                            trigger: 'item'
                        },
                        legend: {
                            top: '5%',
                            left: 'center'
                        },
                        series: [
                            {
                                name: '项目',
                                type: 'pie',
                                radius: ['40%', '70%'],
                                avoidLabelOverlap: false,
                                itemStyle: {
                                    borderRadius: 10,
                                    borderColor: '#fff',
                                    borderWidth: 2
                                },
                                label: {
                                    show: false,
                                    position: 'center'
                                },
                                emphasis: {
                                    label: {
                                        show: true,
                                        fontSize: 40,
                                        fontWeight: 'bold'
                                    }
                                },
                                labelLine: {
                                    show: false
                                },
                                data:this.pie_data
                            }
                        ]
                    };
                    option && myChart.setOption(option);

                }).catch(error => {
                    console.error('There was an error!', error);
                });
            },
            getbar(){
                var chartDom = document.getElementById('feeOrderCount');
                var myChart = echarts.init(chartDom);
                var option;
                axios.get('{:url('/getbar')}').
                then(response => {
                    $data = response.data;
                    var result = $data.data;
                    // this.pie_data = $result;
                    option = {
                        // title: {
                        //     text: '特性示例：渐变色 阴影 点击缩放',
                        //     subtext: 'Feature Sample: Gradient Color, Shadow, Click Zoom'
                        // },
                        xAxis: {
                            type: 'category',
                            data: result.data1
                        },
                        yAxis: {
                            type: 'value'
                        },
                        series: [
                            {
                                data: result.data2,
                                type: 'bar',
                                showBackground: true,
                                itemStyle: {
                                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                                        { offset: 0, color: '#83bff6' },
                                        { offset: 0.5, color: '#188df0' },
                                        { offset: 1, color: '#188df0' }
                                    ])
                                },
                            }
                        ]
                    };
                    option && myChart.setOption(option);

                }).catch(error => {
                    console.error('There was an error!', error);
                });
            },
            beforeDestroy() {
                // 清除定时器
                if (this.timerId) {
                    clearInterval(this.timerId);
                }
            },
        }
    });
    app.$mount('#app');
</script>
</body>
</html>